'use strict';
const db = uniCloud.database();
exports.main = async (event, context) => {
  //event为客户端上传的参数
  const collection = db.collection('posts');
  let page=event.page-1;
  let skip_count=page*event.page_size
  // let posts=await collection.where({"classify":event.classify}).skip(skip_count)
  let posts=await collection.where({"user_id":event.user_id}).skip(skip_count).get()
  //返回数据给客户端
  return {"status":2, "lists":posts.data}
};